package decorator;/** * Created by Administrator on 2018-10-20. */public class Test {    public static void main(String[] args) {        Beverage beverage = new Espresso(); //一杯不需要调料的coffee        System.out.println(beverage.getDescription()+" $"+beverage.cost());        Beverage beverage1 = new HouseBlend();        beverage1 =new Mocha(beverage1);//用摩卡装饰HouseBlend        beverage1 = new Mocha(beverage1);//用第二个摩卡装饰它        beverage1 = new Whip(beverage1);//用whip 继续装饰        System.out.println(beverage1.getDescription()+" $"+beverage1.cost());    }}